package file;

import java.io.File;
import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Home-pc
 * Date: 2023-10-02
 * Time: 10:44
 */
//file类的使用
public class Demo1 {
    public static void main(String[] args) throws IOException {
        File file=new File("d:/123.txt");
        System.out.println(file.getParent());
        System.out.println(file.getName());
        System.out.println(file.getPath());
        System.out.println(file.getAbsoluteFile());
        System.out.println(file.getCanonicalFile());
        System.out.println("$$$$$$$$$$$$$$$$$$$$$$$$");
        File file1=new File("./123.txt");
        System.out.println(file1.getParent());
        System.out.println(file1.getName());
        System.out.println(file1.getPath());
        System.out.println(file1.getAbsoluteFile());
        System.out.println(file1.getCanonicalFile());
    }
}
